import { h, render } from 'vue'
import Message from './Message.vue'
export const message = (content, duration = 3000) => {
  return new Promise((resolve, reject) => {
    const destory = () => {
      render(null, document.body)
    }
    const vnode = h(Message, {
      content,
      duration,
      destory
    })
    render(vnode, document.body)
  })
}
